package com.dang.apj.util;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import sun.misc.BASE64Encoder;


public class Md5Util {

	public static String createMd5Code(String code) throws NoSuchAlgorithmException{
		MessageDigest md = MessageDigest.getInstance("MD5");
		byte[] b = md.digest(code.getBytes());
		BASE64Encoder encoder = new BASE64Encoder();
		return encoder.encode(b);
	}
	
	public static void main(String[] args) throws Exception {
		System.out.println(createMd5Code("123456"));
		
		//System.out.println(getREsult("helloWorld"));
	}

}
